<%@page import="burhan.bean.NotificationBean"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" 
%><%@ page import="com.google.appengine.api.users.User" 
%><%@ page import="com.google.appengine.api.users.UserService" 
%><%@ page import="com.google.appengine.api.users.UserServiceFactory" 
%><%
    UserService userService = UserServiceFactory.getUserService();
    User user = userService.getCurrentUser();
    
    NotificationBean notificationBean = (NotificationBean) request.getAttribute("notificationBean");
%><!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
		<title>Transaction List</title>
		<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7/themes/smoothness/jquery-ui.css" />
		<script type="text/javascript" src="https://www.google.com/jsapi"></script>
		<script type="text/javascript">
			google.load("jquery", "1.7.1");
			google.load("jqueryui", "1.8.16", "{theme: 'UI-Darkness'}");
		</script>
		<script type="text/javascript">
		$(function(){
			$('.datepicker').datepicker({ dateFormat: 'dd-mm-yy' });
		})
		</script>
		<style type="text/css">
			.header{
				text-align: right;
			}
		</style>
	</head>
<body>
	<div class="header">
		<% if(user == null) { %>
			<a href="<%= userService.createLoginURL("/transaction") %>">Sign In</a>
		<% } else { %>
			Hello <%= user.getNickname() %>!
			<a href="<%= userService.createLogoutURL("/transaction") %>">Sign Out</a>
		<% } %>
	</div>
	<%
	if(notificationBean != null && notificationBean.getErrorCount() > 0){
	%><%= notificationBean.getNotificationsHTML() %><%
	}
	%>